<!-- 实训任务 -->
<template>
  <div class="coursebox">
    <div class="innerbox">

      <el-tabs type="border-card" class="demo-tabs" v-model="curtab">
        <el-tab-pane name="first">
          <template #label>
            <span class="custom-tabs-label">
              <!-- <el-icon><calendar /></el-icon> -->
              <span class="circle" :class="{ currentcircle: curtab == 'first' }"></span>
              <span>全部</span>
            </span>
          </template>

          <div class="m-t-30 tabbox">
            <ul class="courselistul clearfix">
              <li class="courseitem">
                <div class="infobox">
                  <div class="examtitle">实训任务通知 <em class="noRead"></em></div>
                  <div class="middlebox">
                    <p class="addresser">发件人：系统</p>
                    <p class="examcourse">课程：高压电工课程</p>
                  </div>
                  <p class="duringtime">2021-12-22（星期二）15:54:21</p>
                </div>
              </li>
              <li class="courseitem">
                <div class="infobox">
                  <div class="examtitle">考试通知 <em class="noRead"></em></div>
                  <div class="middlebox">
                    <p class="addresser">发件人：李刚</p>
                    <p class="examcourse">课程：高压电工课程</p>
                  </div>
                  <p class="duringtime">2021-12-22（星期二）15:54:21</p>
                </div>
              </li>
              <li class="courseitem">
                <div class="infobox">
                  <div class="examtitle">学习通知
                    <!-- <em class="noRead"></em> -->
                  </div>
                  <div class="middlebox">
                    <p class="addresser">发件人：李刚</p>
                    <p class="examcourse">课程：高低压电工课程</p>
                  </div>
                  <p class="duringtime">2021-12-22（星期二）15:54:21</p>
                </div>
              </li>
              <li class="courseitem">
                <div class="infobox">
                  <div class="examtitle">开课通知
                    <!-- <em class="noRead"></em> -->
                  </div>
                  <div class="middlebox">
                    <p class="addresser">发件人：赵四</p>
                    <p class="examcourse">课程：低压电工课程</p>
                  </div>
                  <p class="duringtime">2021-12-22（星期二）15:54:21</p>
                </div>
              </li>
            </ul>
            <el-pagination class="pagebox" :pager-count="5" :page-size="pagesize" :current-page="curpage" background
              layout="prev, pager, next" :total="100" @current-change="pageChange" />
          </div>

        </el-tab-pane>
        <el-tab-pane name="second">
          <template #label>
            <span class="custom-tabs-label">
              <span class="circle" :class="{ currentcircle: curtab == 'second' }"></span>
              <span>已读</span>
            </span>
          </template>
          <div class="m-t-30 tabbox">
            <ul class="courselistul clearfix">
              <li class="courseitem" @click="openExamSum(666)">
                <div class="infobox">
                  <div class="examtitle">学习通知
                    <!-- <em class="noRead"></em> -->
                  </div>
                  <div class="middlebox">
                    <p class="addresser">发件人：李刚</p>
                    <p class="examcourse">课程：高低压电工课程</p>
                  </div>
                  <p class="duringtime">2021-12-22（星期二）15:54:21</p>
                </div>
              </li>
              <li class="courseitem" @click="openExamSum(666)">
                <div class="infobox">
                  <div class="examtitle">开课通知
                    <!-- <em class="noRead"></em> -->
                  </div>
                  <div class="middlebox">
                    <p class="addresser">发件人：赵四</p>
                    <p class="examcourse">课程：低压电工课程</p>
                  </div>
                  <p class="duringtime">2021-12-22（星期二）15:54:21</p>
                </div>
              </li>
            </ul>
            <el-pagination class="pagebox" :pager-count="5" :page-size="pagesize" :current-page="curpage2" background
              layout="prev, pager, next" :total="100" @current-change="pageChange2" />
          </div>
        </el-tab-pane>

      </el-tabs>
    </div>

    <el-dialog v-model="dialogExamVisible" :width="600">
      <div class="studentinfo">
        <div class="status">
          <p>已完成</p>
        </div>
        <div class="examinfo">
          <p>电动机单向连续运转接线(带电动控制)</p>
          <div class="score">
            <span>技能分&nbsp;<em>80</em>&nbsp;分</span>
            <span>素养分&nbsp;<em>80</em>&nbsp;分</span>
          </div>
        </div>
        <div class="name_class">
          <ul>
            <li>
              <div class="labelbox">姓名：</div>
              <div class="contentbox">luffygo</div>
            </li>
            <li>
              <div class="labelbox">小组：</div>
              <div class="contentbox">第三组</div>
            </li>
            <li>
              <div class="labelbox">工位：</div>
              <div class="contentbox">设备3</div>
            </li>
          </ul>
        </div>
        <div class="btnbox">
          <el-button type="primary" class="btnstyle" @click="gotoTrainDetail">查询实训详情</el-button>
        </div>
      </div>
    </el-dialog>
  </div>
</template>

<script setup>
import { ref, onMounted, inject } from 'vue'

// 导入请求路径
import api from '@/request/api'
// 注入网络请求方法
const axios = inject('axios')

import { useRouter } from 'vue-router'
// 初始化路由实例
const router = useRouter()

// 模态框显示标识
const dialogExamVisible = ref(false)
let curtab = ref('first')

let pagesize = ref(9)
let curpage = ref(1)
let curpage2 = ref(1)


onMounted(async () => {
  let res = await axios.post(api.practicemylist, {})
  console.log(res)
  console.log(1)
})

// 打开考试概述
function openTrainSum(eid) {
  console.log(eid);
  dialogExamVisible.value = true
}

// 跳转考试详情
function gotoTrainDetail(eid) {
  console.log(eid);
}

// 全部通知-页数改变
function pageChange(page) {
  console.log(page);
  curpage.value = page
}

// 已读通知-页数改变
function pageChange2(page) {
  console.log(page);
  curpage2.value = page
}
</script>

<style scoped>
.demo-tabs>.el-tabs__content {
  padding: 32px;
  color: #6b778c;
  font-size: 32px;
  font-weight: 600;
}

.demo-tabs .custom-tabs-label .el-icon {
  vertical-align: middle;
}

.demo-tabs .custom-tabs-label span {
  vertical-align: middle;
  margin-left: 4px;
}

.circle {
  box-sizing: border-box;
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 4px;
  /* background-color: skyblue; */
  border: 1px solid skyblue;
}

.describe {
  display: flex;
  align-items: center;
  height: 30px;
  margin-bottom: 20px;
}

.currentcircle {
  background-color: skyblue;
  border: 0;
}

.behindbox i {
  display: block;
  font-family: 'iconfont2' !important;
  font-size: 16px;
  color: #afc5cc;
  margin-right: 10px;
}

.ulbox li {
  display: flex;
  align-items: center;
  height: 40px;
  /* background-color: pink; */
  border-bottom: 1px solid #eee;
  cursor: pointer;
}

.ulbox li p {
  width: 750px;
  margin-right: 150px;
}

.statuslabel {
  font-size: 14px;
}

.studentinfo {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 90%;
  /* height: 150px; */
  margin: 0 auto;
  /* background-color: pink; */
  padding-top: 20px;
}

.studentinfo ul li {
  display: flex;
  height: 28px;
  margin: 0px auto;
  align-items: center;
}

.examinfo {
  width: 70%;
  height: 100px;
  margin: 0 auto;
  /* background-color: skyblue; */
  padding-top: 20px;
}

.examinfo p {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
}

.examinfo .score {
  width: 60%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px auto 0;
}

.examinfo .score em {
  font-size: 20px;
}

.name_class {
  box-sizing: border-box;
  width: 280px;
  padding: 10px 20px;
  font-size: 14px !important;
  background-color: #f2f2f2;
}

.name_class .contentbox {
  font-weight: 550;
}

.btnbox {
  text-align: center;
  margin-top: 40px;
  margin-bottom: 90px;
}

.btnstyle {
  width: 200px;
  margin: 0 auto;
}

.studentinfo .status {
  width: 240px;
  height: 100%;
  text-align: center;
}

.studentinfo .status p {
  color: #0099fe;
  font-size: 30px;
  font-weight: 700;
}
</style>

<style scoped>
.ulbox li .publishtime {
  width: 260px;
  font-size: 14px;
  margin-right: 0px;
}
</style>


<!-- 通知列表 -->
<style scoped>
.coursebox {
  background-color: #f2f4f7;
  padding: 30px;
  /* padding-bottom: 0; */
  /* padding-right: 0; */
}

.innerbox {
  background-color: #fff;
  border-radius: 10px;
  padding: 10px;
  overflow: hidden;
}

.tabbox {
  position: relative;
  height: 720px;
}

.tabbox .pagebox {
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
}

.scrollbar-demo-item {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  margin: 10px;
  text-align: center;
  border-radius: 4px;
  background: var(--el-color-primary-light-9);
  color: var(--el-color-primary);
}

.searchbox {
  float: right;
  display: flex;
  width: 200px;
  height: 36px;
  border: 1px solid #d4d6d9;
  font-size: 14px;
  color: #131b26;
  padding: 0 14px;
  border-radius: 40px;
  align-items: center;
  margin-right: 50px;
}

.searchbox input {
  width: 155px;
  height: 36px;
}

.searchbox:hover {
  border-color: #3a8bff;
}

.searchbox:hover .colorChange {
  color: #3a8bff !important;
}

.borderblue {
  border-color: #3a8bff;
}

.colorblue {
  color: #3a8bff !important;
}

.cursorbtn:hover {
  cursor: pointer;
}

.searchbox:focus {
  /* border-color: #3a8bff; */
  background-color: #000;
}

#searchinp:focus .colorChange {
  color: #3a8bff !important;
}

/* 课程列表具体样式 */
.courselistul {
  width: 900px;
  margin: 0 auto;
  /* perspective: 800px; */
}

.courseitem {
  float: left;
  box-sizing: border-box;
  position: relative;
  width: 280px;
  height: 160px;
  font-size: 12px;
  border: 1px solid #aaa;
  border-radius: 8px;
  cursor: pointer;
  margin-right: 30px;
  margin-bottom: 20px;
  /* box-shadow: 10px 10px 10px #ccc; */
  /* transition: all ease 0.3s; */
}

/* .courseitem:hover {
  transform: translateZ(10px);
  box-shadow: 10px 10px 20px #ccc;
} */

.courseitem:nth-child(3n) {
  margin-right: 0px;
}

.courseitem .infobox {
  position: relative;
  box-sizing: border-box;
  padding: 0 6px;
}

.infobox .examtitle {
  display: inline-block;
  position: relative;
  /* width: 94%; */
  height: 30px;
  line-height: 30px;
  margin: 10px auto 4px;
  padding: 0 10px;
  color: #131b26;
  font-weight: 600;
}

.noRead {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: -5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: red;
}

.infobox p {
  line-height: 17px;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  line-clamp: 1;
  -webkit-box-orient: vertical;
}

.middlebox {
  width: 94%;
  height: 30px;
  align-items: center;
  margin: 0px auto;
}

.middlebox .addresser {
  height: 30px;
  line-height: 30px;
  font-weight: 600;
}

.infobox .duringtime {
  width: 94%;
  margin: 40px auto;
  font-size: 12px;
}
</style>
